package com.modouyu.demo411.demo411.web;

import com.modouyu.demo411.demo411.exception.MyException;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Auther: modouyu
 * @Date: 2018/7/12 08:20
 * @Description:
 * @Email: yangcb@daochunfin.com
 */
@Controller
public class HelloController {


    @RequestMapping("hello")
    public String hello() throws Exception {
        throw new Exception("未知错误");
    }

    @RequestMapping("json")
    public String json() throws MyException {
        throw new MyException("未知错误");
    }

    @RequestMapping("index")
    public String index(ModelMap map) {
        map.addAttribute("host", "https://www.baidu.com");
        return "index";
    }


}
